package com.health.controller;

import com.health.entity.UsersTrade;
import com.health.result.PageResult;
import com.health.result.R;
import com.health.result.Result;
import com.health.service.UsersTradeService;
import com.health.vo.TradeAndAccountVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RequestMapping("/trade")
@RestController
public class UsersTradeController {

    @Autowired
    private UsersTradeService usersTradeService;

    //查看交易记录
    @GetMapping("/record/list")
    public R list(Integer page, Integer pageSize){
         //PageResult usersTrade = usersTradeService.list(page,pageSize);
        List<TradeAndAccountVO> list = usersTradeService.list(page, pageSize);
        return R.success(list);
    }
}
